home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <graphics.h>
- /* Define the pattern names */
- char *patname[] =
- { "Empty", "Solid", "lines", "Thin slashes",
- "Thick slashes", "Thick backslashes",
- "Thin backslashes", "Hatch", "Crosshatch",
- "Interleaving lines", "widely spaced dots",
- "Closely spaced dots", "User defined pattern"};
-
- main()
- {
- int graphdriver = DETECT, graphmode;
- struct fillsettingstype fsettings;
- char buffer[80];
-
- /* Initialize the graphics system */
- initgraph(&graphdriver, &graphmode, "c:\\turboc");
- outtextxy(10, 20, "Demonstrating getfilsettings");
-
- /* Get current fill settings and describe them */
- getfillsettings(&fsettings);
- sprintf(buffer, "Fill pattern is %s, fill color = %d",
- patname[fsettings.pattern], fsettings.color);
- outtextxy(10, 60, buffer);
- outtextxy(10, 80, "Here's how it looks");
- bar(100, 100, 120, 200);
- /* Give user a chance to see the result */
- outtextxy(10, 220, "Hit any key to exit:");
- getch();
- closegraph();
- }